package com.turing.post.organization.util;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

import com.turing.post.util.PCPSUtil;

@SuppressWarnings("serial")
@Entity
@Table(name = "MERCHANTBUSINESSTYPE")
@IdClass(MerchantBusinessType.class)
public class MerchantBusinessType implements java.io.Serializable {

	/**
	 * 商户号
	 */
	private String merchantNo;

	@Id
	@Column(name = "MERCHANTNO", nullable = false)
	public String getMerchantNo() {
		return merchantNo;
	}

	public void setMerchantNo(String merchantNo) {
		this.merchantNo = merchantNo;
	}

	/**
	 * 业务类型
	 */
	private String businessType;

	@Id
	@Column(name = "BUSINESSTYPE", nullable = false)
	public String getBusinessType() {
		return businessType;
	}

	public void setBusinessType(String businessType) {
		this.businessType = businessType;
	}

	/**
	 * 业务类型名称
	 */
	private String businessName;

	@Column(name = "BUSINESSNAME", nullable = false)
	public String getBusinessName() {
		return businessName;
	}

	public void setBusinessName(String businessName) {
		this.businessName = businessName;
	}

	/**
	 * 备注
	 */
	private String remark;

	@Column(name = "REMARK", nullable = false)
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public int hashCode() {
		return PCPSUtil.getObjectListHashCode(new Object[] { getMerchantNo(),
				getBusinessType() });
	}

	@Override
	public boolean equals(Object obj) {
		if ((this == obj))
			return true;
		if ((obj == null))
			return false;
		if (!(obj instanceof MerchantBusinessType))
			return false;
		MerchantBusinessType other = (MerchantBusinessType) obj;

		if (!PCPSUtil
				.compareObject(this.getMerchantNo(), other.getMerchantNo()))
			return false;

		return PCPSUtil.compareObject(this.getBusinessType(), other
				.getBusinessType());
	}
}